home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #15
/
Monster Media Number 15 (Monster Media)(July 1996).ISO
/
prog_bas
/
t2win_32.zip
/
_DIB-BMP.FRM
< prev
next >
Wrap
Text File
|
1996-05-14
|
9KB
|
346 lines
VERSION 4.00
Begin VB.Form frmDIBBitmap
BorderStyle = 4 'Fixed ToolWindow
Caption = "DIB & Bitmap"
ClientHeight = 5685
ClientLeft = 1725
ClientTop = 1785
ClientWidth = 7485
Height = 6090
Left = 1665
MaxButton = 0 'False
MDIChild = -1 'True
ScaleHeight = 5685
ScaleWidth = 7485
ShowInTaskbar = 0 'False
Top = 1440
Width = 7605
Begin VB.CommandButton Command1
Caption = "Load"
Height = 375
Left = 6750
TabIndex = 8
Top = 2610
Visible = 0 'False
Width = 645
End
Begin VB.PictureBox Picture1
AutoRedraw = -1 'True
Height = 2985
Left = 90
ScaleHeight = 2925
ScaleWidth = 7245
TabIndex = 7
Top = 2610
Width = 7305
End
Begin VB.TextBox txt_Result
BackColor = &H00C0C0C0&
BorderStyle = 0 'None
Height = 1845
Left = 105
Locked = -1 'True
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 0
Top = 630
Width = 7260
End
Begin Threed.SSPanel SSPanel1
Align = 1 'Align Top
Height = 480
Left = 0
TabIndex = 1
Top = 0
Width = 7485
_Version = 65536
_ExtentX = 13203
_ExtentY = 847
_StockProps = 15
ForeColor = -2147483640
BackColor = 12632256
Begin VB.ComboBox cmb_Function
Height = 315
Left = 1365
TabIndex = 2
Top = 90
Width = 4785
End
Begin Threed.SSCommand SSCommand1
Default = -1 'True
Height = 300
Left = 6615
TabIndex = 6
Top = 90
Width = 465
_Version = 65536
_ExtentX = 820
_ExtentY = 529
_StockProps = 78
Caption = "&Go"
BevelWidth = 1
RoundedCorners = 0 'False
Outline = 0 'False
End
Begin VB.Label Label2
Caption = "&Select a function"
Height = 255
Left = 90
TabIndex = 5
Top = 120
Width = 1275
End
Begin Threed.SSCommand cmdNP
Height = 300
Index = 0
Left = 6300
TabIndex = 4
Top = 90
Width = 255
_Version = 65536
_ExtentX = 450
_ExtentY = 529
_StockProps = 78
Caption = "<"
BevelWidth = 1
Font3D = 3
RoundedCorners = 0 'False
Outline = 0 'False
End
Begin Threed.SSCommand cmdNP
Height = 300
Index = 1
Left = 7140
TabIndex = 3
Top = 90
Width = 255
_Version = 65536
_ExtentX = 450
_ExtentY = 529
_StockProps = 78
Caption = ">"
BevelWidth = 1
Font3D = 3
RoundedCorners = 0 'False
Outline = 0 'False
End
End
End
Attribute VB_Name = "frmDIBBitmap"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Option Explicit
Option Base 1
Private Const Iteration = 3
Dim IsLoaded As Integer
Dim TimerStartOk As Integer
Dim TimerCloseOk As Integer
Dim TimerHandle As Integer
Dim TimerValue As Long
Private Sub cmdNP_Click(Index As Integer)
Call sub_NextPrev(cmb_Function, Index)
End Sub
Private Sub cmb_Function_Click()
If (IsLoaded = False) Then Exit Sub
Call cDisableFI(mdiT2W.Picture1)
txt_Result = ""
DoEvents
Command1.Visible = False
Picture1.Width = 7305
Select Case cmb_Function.ListIndex
Case 0
Call TestDIBSaveScreen
Case 1
Call TestDIBSaveWindow
Case 2
Picture1.Width = 6585
Command1.Visible = True
Call TestInstallHookKeyboard
End Select
DoEvents
Call cEnableFI(mdiT2W.Picture1)
End Sub
Private Sub Command1_Click()
If (cFilePathExists(T2WDirTest + "\TESTDIB.BMP") = True) Then
Picture1.Picture = LoadPicture(T2WDirTest + "\TESTDIB.BMP")
Else
MsgBox "File '" & T2WDirTest + "\TESTDIB.BMP" & "' not found"
End If
End Sub
Private Sub Form_Activate()
mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
End Sub
Private Sub Form_Load()
IsLoaded = False
Show
Call sub_Load_Combo(cmb_Function, T2WDirInst + "_dib-bmp.t2w")
IsLoaded = True
End Sub
Private Sub SSCommand1_Click()
Call cmb_Function_Click
End Sub
Private Sub TestDIBSaveWindow()
Dim intResult As Integer
Dim strResult As String
Dim strDisplay As String
Dim strFile As String
Dim i As Integer
strFile = T2WDirTest + "\snap_win.bmp"
intResult = cDIBSaveWindow(Me.hWnd, DIB_SAVE_WINDOW, strFile)
If (intResult = True) Then
strDisplay = strDisplay & "Active window has been saved" & vbCrLf & "in the file '" & strFile & "'" & vbCrLf & vbCrLf
Else
strDisplay = strDisplay & "Active window can't be saved" & vbCrLf & "in the file '" & strFile & "'" & vbCrLf & vbCrLf
End If
txt_Result = strDisplay
Picture1.Picture = LoadPicture(strFile)
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
intResult = cDIBSaveWindow(Me.hWnd, DIB_SAVE_WINDOW, strFile)
Next i
intResult = cKillFile(strFile)
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub
Private Sub TestDIBSaveScreen()
Dim intResult As Integer
Dim strResult As String
Dim strDisplay As String
Dim strFile As String
Dim i As Integer
strFile = T2WDirTest + "\snap_scr.bmp"
intResult = cDIBSaveScreen(strFile)
If (intResult = True) Then
strDisplay = strDisplay & "Screen has been saved" & vbCrLf & "in the file '" & strFile & "'" & vbCrLf & vbCrLf
Else
strDisplay = strDisplay & "Screen can't be saved" & vbCrLf & "in the file '" & strFile & "'" & vbCrLf & vbCrLf
End If
txt_Result = strDisplay
Picture1.Picture = LoadPicture(strFile)
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
intResult = cDIBSaveScreen(strFile)
Next i
intResult = cKillFile(strFile)
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub
Private Sub TestInstallHookKeyboard()
Dim intResult As Integer
Dim strResult As String
Dim strDisplay As String
Dim strFile As String
Dim i As Integer
intResult = cInstallHookKeyboard(True)
If (intResult = True) Then
strDisplay = strDisplay & "InstallHookKeyboard has been successfully installed" & vbCrLf & vbCrLf
Else
strDisplay = strDisplay & "InstallHookKeyboard has been already installed" & vbCrLf & vbCrLf
End If
strDisplay = strDisplay & "Press ALT+CTRL+SHIFT+F11 to save the screen" & vbCrLf
strDisplay = strDisplay & "Press ALT+CTRL+SHIFT+F12 to save the active window" & vbCrLf & vbCrLf
strDisplay = strDisplay & "For the test" & vbCrLf
strDisplay = strDisplay & " don't change the directory" & vbCrLf
strDisplay = strDisplay & " enter the name of the file TESTDIB" & vbCrLf
strDisplay = strDisplay & " select a file type" & vbCrLf
strDisplay = strDisplay & " push the OK button" & vbCrLf
strDisplay = strDisplay & " push the LOAD command button" & vbCrLf
txt_Result = strDisplay
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
intResult = cInstallHookKeyboard(True)
Next i
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub